﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Mobile.Master" Inherits="System.Web.Mvc.ViewPage<WebStickyNotes.Models.MobileTaskModel>" %>
<%@ Import Namespace="WebStickyNotes.Resources" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
	<%= Model.Task.Task.Title %>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
   <nav>
		<div class="splitleft">
			<%= Html.ActionLink(Labels.Home, "Index", "Mobile") %>
        </div>
		<div class="splitright">
			<%= Html.ActionLink(Labels.Up, "Tasks", "Mobile", new { id = Model.Task.Stream.Id }, null) %>
        </div>
    </nav>
	<% bool canEdit = (Model.CurrentUser.TaskRoleId == 1 || Model.CurrentUser.Id == Model.Task.Person.Id);%>
	<p>&nbsp;</p>
    <% if (canEdit) {%>
    <article class="stickynote" id="Task_<%=Model.Task.Task.Id%>">
        <h2><%=Model.Task.Task.Title %></h2>
        <section>
			<p><%= Html.ActionLink(Labels.TaskStream + " - " + Model.Task.Stream.Title, "TaskChangeStream", new { id = Model.Task.Task.Id }, null) %></p>
			<p><%= Html.ActionLink(Labels.TaskPerson + " - " + Model.Task.Person.FirstName + " " + Model.Task.Person.LastName, "TaskChangePerson", new { id = Model.Task.Task.Id }, null) %></p>
			<p><%= Html.ActionLink(Labels.TaskPriority + " - " + Model.Task.Priority.Title, "TaskChangePriority", new { id = Model.Task.Task.Id }, null) %></p>
			<p><%= Html.ActionLink(Labels.Release + " - " + Model.Task.Task.Release, "TaskChangeRelease", new { id = Model.Task.Task.Id }, null) %></p>
			<p><%= Html.ActionLink(Labels.MilestoneDate + " - " + Model.Task.Task.MilestoneDate.ToString("dd/MM/yyyy"), "TaskChangeMilestone", new { id = Model.Task.Task.Id }, null) %></p>
			<p><%= Html.ActionLink(Labels.PercentageComplete + " - " + Model.Task.Task.PercentageComplete + "%", "TaskChangeProgress", new { id = Model.Task.Task.Id }, null) %></p>
        </section>
    </article>
    <% } else {%>
    <article class="staticnote" id="Task_<%= Model.Task.Task.Id%>">
        <h2><%=Model.Task.Task.Title %></h2>
        <section>
			<p><%= Labels.TaskStream %> - <span><%= Model.Task.Stream.Title %></span></p>
            <p><%= Labels.TaskPerson %> - <span><%= Model.Task.Person.FirstName %> <%= Model.Task.Person.LastName %></span></p>
            <p><%= Labels.TaskPriority %> - <span><%= Model.Task.Priority.Title%></span></p>
            <p><%= Labels.Release %> - <span><%= Model.Task.Task.Release%></span></p>
            <p><%= Labels.MilestoneDate %> - <span><%= Model.Task.Task.MilestoneDate.ToString("dd/MM/yyyy") %></span></p>
            <% Html.RenderPartial("Progress", Model.Task); %>
        </section>
    </article>
    <% }%>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="ScriptContent" runat="server">
</asp:Content>
